/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package egresados4;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 *
 * @author murrieta
 */
@Entity
@Table(name = "PAI", catalog = "", schema = "EGRESADOS")
@NamedQueries({@NamedQuery(name = "Pai.findAll", query = "SELECT p FROM Pai p"), @NamedQuery(name = "Pai.findByPaiPaiid", query = "SELECT p FROM Pai p WHERE p.paiPaiid = :paiPaiid"), @NamedQuery(name = "Pai.findByPaiPais", query = "SELECT p FROM Pai p WHERE p.paiPais = :paiPais")})
public class Pai implements Serializable {
    @Transient
    private PropertyChangeSupport changeSupport = new PropertyChangeSupport(this);
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "PAI_PAIID")
    private Integer paiPaiid;
    @Basic(optional = false)
    @Column(name = "PAI_PAIS")
    private String paiPais;

    public Pai() {
    }

    public Pai(Integer paiPaiid) {
        this.paiPaiid = paiPaiid;
    }

    public Pai(Integer paiPaiid, String paiPais) {
        this.paiPaiid = paiPaiid;
        this.paiPais = paiPais;
    }

    public Integer getPaiPaiid() {
        return paiPaiid;
    }

    public void setPaiPaiid(Integer paiPaiid) {
        Integer oldPaiPaiid = this.paiPaiid;
        this.paiPaiid = paiPaiid;
        changeSupport.firePropertyChange("paiPaiid", oldPaiPaiid, paiPaiid);
    }

    public String getPaiPais() {
        return paiPais;
    }

    public void setPaiPais(String paiPais) {
        String oldPaiPais = this.paiPais;
        this.paiPais = paiPais;
        changeSupport.firePropertyChange("paiPais", oldPaiPais, paiPais);
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (paiPaiid != null ? paiPaiid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Pai)) {
            return false;
        }
        Pai other = (Pai) object;
        if ((this.paiPaiid == null && other.paiPaiid != null) || (this.paiPaiid != null && !this.paiPaiid.equals(other.paiPaiid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "egresados4.Pai[paiPaiid=" + paiPaiid + "]";
    }

    public void addPropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.addPropertyChangeListener(listener);
    }

    public void removePropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.removePropertyChangeListener(listener);
    }

}
